<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../vue.js"></script>
    <script>
        window.onload=function(){
            var app=new Vue({
                el:'#app',
                data:{
                    name:'tom',
                    age:12
                },
                beforeCreate:function(){
                    //this->当前vue实例
                    alert('beforeCreate'+this.name)
                },
                created:function(){
                    alert('created'+this.name)
                },
                beforeMount:function(){
                    alert('beforeMount'+this.name)
                },
                mounted:function(){
                    alert('mounted'+this.name)
                }

            })
            // console.log(app.name);
        }
    </script>
</head>
<body>
    <div id="app">
        {{name}}--{{age}}
    </div>
</body>
</html>